
from rest_framework.generics import ListAPIView
from rest_framework.viewsets import ModelViewSet
from meiduo_admin.serializers.admin_serializers import *
from meiduo_admin.custom_page import MyPage


class AdminGroupSimpleListView(ListAPIView):
    queryset = Group.objects.all()
    serializer_class = GroupSimpleSerializer


class AdminViewSet(ModelViewSet):
    queryset = User.objects.all()
    serializer_class = AdminModelSerializer
    pagination_class = MyPage

    def get_queryset(self):
        return self.queryset.filter(is_staff=True)